package LECONGHAU.OOP.EXCERCISE01.BAI6;

import java.util.Scanner;

public class CONTROLLER {
	String so,chon;
public void nhap(){

do{
System.out.println("nhap vao so");
Scanner sc=new Scanner(System.in);
so=sc.nextLine();
System.out.println("chon kieu 0->chan, 1->le");
chon=sc.nextLine();
if(so.isEmpty()||chon.isEmpty()){
	System.out.println("vui long nhap lai");
}
}while(so.isEmpty()||chon.isEmpty());
}
public String checkIsEventOdd(){
	int intso=Integer.parseInt(so);
	int intchon=Integer.parseInt(chon);
	int sodau=0;
	int dem = 0;
	switch (intchon) {
	case 0:
	for(int i=0;i<=intso;i++){
			
			if(i%2==0){
				dem++;
			}
			
		}
		return "so so chan la "+dem;
	case 1:
		for(int i=0;i<=intso;i++){
			
			if(i%2!=0){
				dem++;
			}
			
		}
		return "so so le la"+dem;

	default:return "chon nham roi nha";
	}
}
}
